/********************************************
*
*	File: 		operations.h
*	Name: 		Rob King
*	Project:	Project 2
*
********************************************/
#include "glob.h"
#include "virtualmem.h"

#ifndef OPERATIONS_H_
#define OPERATIONS_H_

void LoadRegister(VMEMMOD * vm, size_t memLocation);
void LoadLow(VMEMMOD * vm, size_t memLocation);
void LoadHigh(VMEMMOD * vm, size_t memLocation);
void StoreRegister(VMEMMOD * vm, size_t memLocation);
void SetStackPointer(VMEMMOD * vm, size_t memLocation);
void StoreStackPointer(VMEMMOD * vm);
void PushStack(VMEMMOD* vm);
void PopStack(VMEMMOD* vm);
void CompareEqual(VMEMMOD* vm, size_t memLocation);
void CompareLessThan(VMEMMOD* vm, size_t memLocation);
void BranchConditional(VMEMMOD* vm, size_t memLocation);
void BranchUnconditional(VMEMMOD* vm, size_t memLocation);
void GetData(VMEMMOD* vm, size_t memLocation);
void PutData(VMEMMOD* vm, size_t memLocation);
void Add(VMEMMOD* vm, size_t memLocation);
void Subtract(VMEMMOD* vm, size_t memLocation);
void Multiply(VMEMMOD* vm, size_t memLocation);
void Divide(VMEMMOD* vm, size_t memLocation);
void AddStack(VMEMMOD* vm);
void SubtractStack(VMEMMOD* vm);
void MultiplyStack(VMEMMOD* vm);
void DivideStack(VMEMMOD* vm);
void NoOp(VMEMMOD* vm);
void Halt(VMEMMOD* vm);
void SendMess(VMEMMOD* vm, u_int16_t nToProc);
int ReceiveMess(VMEMMOD* vm, u_int16_t nFromProc);
void PutPID(VMEMMOD* vm, u_int16_t nPID);
int Fork(VMEMMOD* vm);
int Exec(VMEMMOD* vm, char upperchar, char lowerchar);
void LoadShared(VMEMMOD* vm, size_t o3);
void StoreShared(VMEMMOD* vm, size_t o3);
int P(VMEMMOD* vm, size_t o3);
int V(VMEMMOD* vm, size_t o3);
void SemaphoreInit(VMEMMOD* vm, size_t o3);

#endif /* OPERATIONS_H_ */
